/**
 * Get the HTML form.
 * @param namespace
 * @param frmName
 * @return
 */
function getForm(namespace, frmName) {
	return document.forms[namespace + frmName];
}
/**
 * Validate for logging
 * @return
 */
function Validate(namespace, frmName, eventId) {
    var frm= getForm(namespace, frmName);
    var user = frm.username;
    var pass= frm.password;
    if((user.value ==null)||(user.value=="")) {
       alert("please enter username");
       user.focus();  
       
    }else if((pass.value ==null)||(pass.value=="")) {
           alert("please enter password");
           pass.focus();           
    }else if((user.value == "thangvd1")&&(pass.value=="thangvd1")) {
	frm.eventId.value = eventId;
	frm.submit();       
    }else {
	alert("please input valid username and password");
    }
}

/**
 * Submit the form.
 * @param namespace
 * @param frmName
 * @param eventId
 * @return
 */
function submitAction(namespace, frmName, eventId) {
	var frm = getForm(namespace, frmName);
	frm.eventId.value = eventId;
	frm.submit();
}

/**
 * Submit the form of dynamic Menu
 * @param namespace
 * @param frmName
 * @param eventId
 * @param itemId
 * @return
 */
function submitMenu(namespace, frmName, eventId, itemId) {
	var frm = getForm(namespace, frmName);
	frm.eventId.value = eventId;
	frm.itemId.value = itemId;
	frm.submit();
}

